import java.awt.Dimension;
import java.awt.geom.Point2D;

/**
 * 
 * @author Bruce Fu and Michael Elgart
 *
 */
public class Global {
    /**
     * Store the global variables and provide methods to access or edit them.
     */
    private static double ourGravityDirectionDefault = 90;
    private static double ourGravityDirection = ourGravityDirectionDefault;
    private static double ourGravityMagnitudeDefault = 0;
    private static double ourGravityMagnitude = ourGravityMagnitudeDefault;
    
    private static double ourViscosityDefault = 0;
    private static double ourViscosity = ourViscosityDefault;

    private static double ourCenterMassMagnitudeDefault = 0;
    private static double ourCenterMassMagnitude = ourCenterMassMagnitudeDefault;
    private static double ourCenterMassExponentDefault = 2;
    private static double ourCenterMassExponent = ourCenterMassExponentDefault;
    
    private static double ourWallTopMagnitudeDefault = 0;
    private static double ourWallTopMagnitude = ourWallTopMagnitudeDefault;
    private static double ourWallTopExponentDefault = 2;
    private static double ourWallTopExponent = ourWallTopExponentDefault;

    private static double ourWallRightMagnitudeDefault = 0;
    private static double ourWallRightMagnitude = ourWallRightMagnitudeDefault;
    private static double ourWallRightExponentDefault = 2;
    private static double ourWallRightExponent = ourWallRightExponentDefault;

    private static double ourWallLeftMagnitudeDefault = 0;
    private static double ourWallLeftMagnitude = ourWallLeftMagnitudeDefault;
    private static double ourWallLeftExponentDefault = 2;
    private static double ourWallLeftExponent = ourWallLeftExponentDefault;

    private static double ourWallBottomMagnitudeDefault = 0;
    private static double ourWallBottomMagnitude = ourWallBottomMagnitudeDefault;
    private static double ourWallBottomExponentDefault = 2;
    private static double ourWallBottomExponent = ourWallBottomExponentDefault;
    
    private static Point2D ourCanvasCenter;
    private static Dimension ourCanvasDim;
    private static final double ZERO = 0;

    public static void setGravityDirection(double direction) {
        ourGravityDirection = direction;
    }
    
    public static void setGravityDirectionDefault(double direction) {
        ourGravityDirectionDefault = direction;
    }
    
    public static void setGravityMagnitude(double magnitude) {
        ourGravityMagnitude = magnitude;
    }
    
    public static void setGravityMagnitudeDefault(double magnitude) {
        ourGravityMagnitudeDefault = magnitude;
    }
    
    public static double getGravityDirection() {
        return ourGravityDirection;
    }
    
    public static double getGravityDirectionDefault() {
        return ourGravityDirectionDefault;
    }
    
    public static double getGravityMagnitude() {
        return ourGravityMagnitude;
    }
    
    public static double getGravityMagnitudeDefault() {
        return ourGravityMagnitudeDefault;
    }
    
    public static void setViscosity(double scaleValue) {
        ourViscosity = scaleValue;
    }
    
    public static void setViscosityDefault(double scaleValue) {
        ourViscosityDefault = scaleValue;
    }
    
    public static double getViscosity() {
        return ourViscosity;
    }
    
    public static double getViscosityDefault() {
        return ourViscosityDefault;
    }
    
    public static void setCenterMassMagnitude(double magnitude) {
        ourCenterMassMagnitude = magnitude;
    }

    public static void setCenterMassMagnitudeDefault(double magnitude) {
        ourCenterMassMagnitudeDefault = magnitude;
    }
    
    public static double getCenterMassMagnitude() {
        return ourCenterMassMagnitude;
    }
    
    public static double getCenterMassMagnitudeDefault() {
        return ourCenterMassMagnitudeDefault;
    }
    
    public static void setCenterMassExponent(double exponent) {
        ourCenterMassExponent = exponent;
    }
    
    public static void setCenterMassExponentDefault(double exponent) {
        ourCenterMassExponentDefault = exponent;
    }
    
    public static double getCenterMassExponent() {
        return ourCenterMassExponent;
    }
    
    public static double getCenterMassExponentDefault() {
        return ourCenterMassExponentDefault;
    }
    
    
    //Wall Forces
    //Top Wall forces
    public static void setWallTopMagnitude(double magnitude) {
        ourWallTopMagnitude = magnitude;
    }
    
    public static double getWallTopMagnitude() {
        return ourWallTopMagnitude;
    }
    
    public static void setWallTopMagnitudeDefault(double magnitude) {
        ourWallTopMagnitudeDefault = magnitude;
    }
    
    public static double getWallTopMagnitudeDefault() {
        return ourWallTopMagnitudeDefault;
    }
    
    
    public static void setWallTopExponent(double exponent) {
        ourWallTopExponent = exponent;
    }
    
    public static double getWallTopExponent() {
        return ourWallTopExponent;
    }
    
    public static void setWallTopExponentDefault(double exponent) {
        ourWallTopExponentDefault = exponent;
    }
    
    public static double getWallTopExponentDefault() {
        return ourWallTopExponentDefault;
    }

    //Wall Right
    public static void setWallRightMagnitude(double magnitude) {
        ourWallRightMagnitude = magnitude;
    }
    
    public static double getWallRightMagnitude() {
        return ourWallRightMagnitude;
    }
    
    public static void setWallRightMagnitudeDefault(double magnitude) {
        ourWallRightMagnitudeDefault = magnitude;
    }
    
    public static double getWallRightMagnitudeDefault() {
        return ourWallRightMagnitudeDefault;
    }
    
    public static void setWallRightExponent(double exponent) {
        ourWallRightExponent = exponent;
    }
    
    public static double getWallRightExponent() {
        return ourWallRightExponent;
    }
    
    public static void setWallRightExponentDefault(double exponent) {
        ourWallRightExponentDefault = exponent;
    }
    
    public static double getWallRightExponentDefault() {
        return ourWallRightExponentDefault;
    }
    
    //Left Wall
    public static void setWallLeftMagnitude(double magnitude) {
        ourWallLeftMagnitude = magnitude;
    }
    
    public static double getWallLeftMagnitude() {
        return ourWallLeftMagnitude;
    }
    
    public static void setWallLeftMagnitudeDefault(double magnitude) {
        ourWallLeftMagnitudeDefault = magnitude;
    }
    
    public static double getWallLeftMagnitudeDefault() {
        return ourWallLeftMagnitudeDefault;
    }
    
    public static void setWallLeftExponent(double exponent) {
        ourWallLeftExponent = exponent;
    }
    
    public static double getWallLeftExponent() {
        return ourWallLeftExponent;
    }
    
    public static void setWallLeftExponentDefault(double exponent) {
        ourWallLeftExponentDefault = exponent;
    }
    
    public static double getWallLeftExponentDefault() {
        return ourWallLeftExponentDefault;
    }
    
    //Bottom Wall
    public static void setWallBottomMagnitude(double magnitude) {
        ourWallBottomMagnitude = magnitude;
    }
    
    public static double getWallBottomMagnitude() {
        return ourWallBottomMagnitude;
    }
    
    public static void setWallBottomMagnitudeDefault(double magnitude) {
        ourWallBottomMagnitudeDefault = magnitude;
    }
    
    public static double getWallBottomMagnitudeDefault() {
        return ourWallBottomMagnitudeDefault;
    }
    
    public static void setWallBottomExponent(double exponent) {
        ourWallBottomExponent = exponent;
    }
    
    public static double getWallBottomExponent() {
        return ourWallBottomExponent;
    }
    
    public static void setWallBottomExponentDefault(double exponent) {
        ourWallBottomExponentDefault = exponent;
    }
    
    public static double getWallBottomExponentDefault() {
        return ourWallBottomExponentDefault;
    }
       
    public static void setCanvasCenter(Dimension dim) {
        ourCanvasCenter = new Point2D.Double(dim.getWidth()/2, dim.getHeight()/2);
    }
       
    public static Point2D getCanvasCenter() {
        return ourCanvasCenter;
    }
    
    public static void setCanvasDim(Dimension newDim) {
        ourCanvasDim = newDim;
    }
       
    public static Dimension getCanvasDim() {
        return ourCanvasDim;
    }
    
    public static double getZero() {
        return ZERO;
    }
}
